package com.saascloud.config;

import com.saascloud.config.properties.SmsProperties;
import com.saascloud.core.SmsSend;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;

/**
 * @author: one_dream@aliyun.com
 * @date: Created in 2022/8/19 14:24
 * @description
 */
@EnableConfigurationProperties(SmsProperties.class)
@Slf4j
public class MsgAutoConfiguration {

    @Bean
    @ConditionalOnMissingBean
    @ConditionalOnProperty(name = "sms.smsUrl")
    SmsSend smsSend() {
        log.info("...初始化消息平台短信客户端...");
        return new SmsSend();
    }

}
